home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / present_.swf / scripts / DefineSprite_253 / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2011-03-26  |  2.1 KB  |  67 lines

  1. function onReplyData(success)
  2. {
  3.    trace("adtat Valasz XML:" + replyDataServer.toString());
  4.    switch(replyDataServer.status)
  5.    {
  6.       case 0:
  7.          msg = "No error; parse was completed successfully.";
  8.          break;
  9.       case -2:
  10.          msg = "A CDATA section was not properly terminated.";
  11.          break;
  12.       case -3:
  13.          msg = "The XML declaration was not properly terminated.";
  14.          break;
  15.       case -4:
  16.          msg = "The DOCTYPE declaration was not properly terminated.";
  17.          break;
  18.       case -5:
  19.          msg = "A comment was not properly terminated.";
  20.          break;
  21.       case -6:
  22.          msg = "An XML element was malformed.";
  23.          break;
  24.       case -7:
  25.          msg = "Out of memory.";
  26.          break;
  27.       case -8:
  28.          msg = "An attribute value was not properly terminated.";
  29.          break;
  30.       case -9:
  31.          msg = "A start-tag was not matched with an end-tag.";
  32.          break;
  33.       case -10:
  34.          msg = "An end-tag was encountered without a matching start-tag";
  35.    }
  36.    replyRoot = replyDataServer.firstChild;
  37.    if(success)
  38.    {
  39.       trace(replyRoot.lastChild.attributes.result);
  40.    }
  41.    else
  42.    {
  43.       trace("------hiba az XML betoltesenel!");
  44.    }
  45.    hideWindow();
  46.    _root.gotoToplist();
  47. }
  48. function sendDataToServer(clientid, password)
  49. {
  50.    sendData = new XML();
  51.    sendData.xmlDecl = " <?xml version=\'1.0\' encoding=\'UTF-8\' ?>";
  52.    sendDataElement = sendData.createElement("ask");
  53.    sendData.appendChild(sendDataElement);
  54.    dataElement = sendData.createElement("data");
  55.    dataElement.attributes.action = "add_score";
  56.    dataElement.attributes.xmas2004_sid = _root.sid;
  57.    dataElement.attributes.name = name.text;
  58.    dataElement.attributes.email = email1.text + "@" + email2.text;
  59.    dataElement.attributes.score = String(_root.clock.getTime());
  60.    sendDataElement.appendChild(dataElement);
  61.    sendData.sendAndLoad("processor.php",replyDataServer);
  62. }
  63. system.useCodePage = false;
  64. replyDataServer = new XML();
  65. replyDataServer.ignoreWhite = true;
  66. replyDataServer.onLoad = onReplyData;
  67.